package com.yunlong.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import java.util.Objects;


/**
 * @author guorui
 * @date 2021-07-16 09:57
 */
@RestController
@RequestMapping("/upload")
@CrossOrigin
public class UploadController {
    @ApiOperation("管理员批量导入学生信息")
    @PostMapping("/singlefile")
    public Object singleFileUpload(MultipartFile file) {
        if (Objects.isNull(file) || file.isEmpty()) {
            System.out.println("文件为空");
            return "文件为空，请重新上传";
        }


        return "文件上传成功";
    }
}

